﻿#region

using SqlSugar;
using Vin.Extension.Framework.SugarFilter;
using Vin.Extension.SqlSugar.SugarFilter;

#endregion

namespace Vin.Extension.Framework.Entities;

public class VinFrameworkBaseEntity : VinBaseEntity, IDeleted, IEnabled, IDataScope
{
    /// <summary>
    /// 是否启用
    /// </summary>
    [SugarColumn(ColumnDescription = "是否启用", DefaultValue = "1", CreateTableFieldSort = 9000)]
    public bool? IsEnabled { get; set; }

    /// <summary>
    /// 创建人id
    /// </summary>
    [SugarColumn(DefaultValue = "0", ColumnDescription = "创建人id", CreateTableFieldSort = 10002)]
    public long? CreateUserId { get; set; }

    /// <summary>
    /// 创建人名称
    /// </summary>
    [SugarColumn(DefaultValue = "''", ColumnDescription = "创建人名称", CreateTableFieldSort = 10003)]
    public string? CreateUserName { get; set; }

    /// <summary>
    /// 创建人的账号id
    /// </summary>
    [SugarColumn(DefaultValue = "0", ColumnDescription = "创建人的账号id", CreateTableFieldSort = 10004)]
    public long? CreateAccountId { get; set; }

    /// <summary>
    /// 创建人的账号名称
    /// </summary>
    [SugarColumn(DefaultValue = "''", ColumnDescription = "创建人的账号名称", CreateTableFieldSort = 10005)]
    public string? CreateAccountName { get; set; }

    /// <summary>
    /// 更新人id
    /// </summary>
    [SugarColumn(DefaultValue = "0", ColumnDescription = "更新人id", CreateTableFieldSort = 10011)]
    public long? UpdateUserId { get; set; }

    /// <summary>
    /// 更新人名称
    /// </summary>
    [SugarColumn(DefaultValue = "''", ColumnDescription = "更新人名称", CreateTableFieldSort = 10012)]
    public string? UpdateUserName { get; set; }

    /// <summary>
    /// 更新人的账号id
    /// </summary>
    [SugarColumn(DefaultValue = "0", ColumnDescription = "更新人的账号id", CreateTableFieldSort = 10013)]
    public long? UpdateAccountId { get; set; }

    /// <summary>
    /// 更新人的账号名称
    /// </summary>
    [SugarColumn(DefaultValue = "''", ColumnDescription = "更新人的账号名称", CreateTableFieldSort = 10014)]
    public string? UpdateAccountName { get; set; }

    /// <summary>
    /// 是否删除
    /// </summary>
    [SugarColumn(DefaultValue = "0", ColumnDescription = "是否删除", CreateTableFieldSort = 20000)]
    public bool? IsDeleted { get; set; }
}

public record VinFrameworkBaseRecordEntity : VinBaseRecordEntity, IDeleted, IEnabled, IDataScope
{
    /// <summary>
    /// 是否启用
    /// </summary>
    [SugarColumn(ColumnDescription = "是否启用", DefaultValue = "1", CreateTableFieldSort = 9000)]
    public bool? IsEnabled { get; set; }

    /// <summary>
    /// 创建人id
    /// </summary>
    [SugarColumn(DefaultValue = "0", ColumnDescription = "创建人id", CreateTableFieldSort = 10002)]
    public long? CreateUserId { get; set; }

    /// <summary>
    /// 创建人名称
    /// </summary>
    [SugarColumn(DefaultValue = "''", ColumnDescription = "创建人名称", CreateTableFieldSort = 10003)]
    public string? CreateUserName { get; set; }

    /// <summary>
    /// 创建人的账号id
    /// </summary>
    [SugarColumn(DefaultValue = "0", ColumnDescription = "创建人的账号id", CreateTableFieldSort = 10004)]
    public long? CreateAccountId { get; set; }

    /// <summary>
    /// 创建人的账号名称
    /// </summary>
    [SugarColumn(DefaultValue = "''", ColumnDescription = "创建人的账号名称", CreateTableFieldSort = 10005)]
    public string? CreateAccountName { get; set; }

    /// <summary>
    /// 更新人id
    /// </summary>
    [SugarColumn(DefaultValue = "0", ColumnDescription = "更新人id", CreateTableFieldSort = 10011)]
    public long? UpdateUserId { get; set; }

    /// <summary>
    /// 更新人名称
    /// </summary>
    [SugarColumn(DefaultValue = "''", ColumnDescription = "更新人名称", CreateTableFieldSort = 10012)]
    public string? UpdateUserName { get; set; }

    /// <summary>
    /// 更新人的账号id
    /// </summary>
    [SugarColumn(DefaultValue = "0", ColumnDescription = "更新人的账号id", CreateTableFieldSort = 10013)]
    public long? UpdateAccountId { get; set; }

    /// <summary>
    /// 更新人的账号名称
    /// </summary>
    [SugarColumn(DefaultValue = "''", ColumnDescription = "更新人的账号名称", CreateTableFieldSort = 10014)]
    public string? UpdateAccountName { get; set; }

    /// <summary>
    /// 是否删除
    /// </summary>
    [SugarColumn(DefaultValue = "0", ColumnDescription = "是否删除", CreateTableFieldSort = 20000)]
    public bool? IsDeleted { get; set; }
}